type union_t1 = int|float|bool|u8|i64

fn bool_test():bool {
    return true
}

fn main() {
    int? foo = null
    int bar = match foo {
        is int -> foo
        is null -> -1
    }

    assert(bar== -1)

    union_t1 foo2 = 3.14
    if foo2 is float {
        assert(foo2 == 3.14)
    }

    match foo2 {
       is int -> assert(false)
       is float -> assert(foo2 == 3.14)
       is bool -> assert(false)
       is u8 -> assert(false)
    }

    union_t1 foo3 = true
    if false {
    } else if true && (1 > 0 || 2 > 0) && foo3 is bool && bool_test() {
        assert(foo3 == true)
    } else {
        assert(false)
    }
}
